/**
 * PDF生成器插件样式表
 * 
 * 设计理念：现代化、简洁、高效
 * 技术特点：使用CSS Grid和Flexbox进行响应式布局，类似于GUI框架中的布局管理器
 */

/* 重置和基础样式 - 消除浏览器默认样式差异 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 600px;
  width: 380px; /* 插件固定宽度，保证界面一致性 */
}

/* 主容器布局 - 使用Flexbox垂直布局 */
.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px); /* 毛玻璃效果，提升视觉层次 */
  border-radius: 12px;
  margin: 8px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 头部样式 */
header {
  padding: 20px 20px 15px;
  text-align: center;
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 12px 12px 0 0;
  color: white;
}

header h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
}

.subtitle {
  font-size: 11px;
  opacity: 0.9;
}

/* 主要内容区域 */
main {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

/* 状态显示区域 */
.status-section {
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9ff;
  border-radius: 8px;
  border-left: 3px solid #4facfe;
}

.url-display {
  font-size: 11px;
  color: #666;
  font-family: 'Courier New', monospace; /* 等宽字体显示URL */
  word-break: break-all;
}

/* 选项区域 */
.options-section h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #333;
  display: flex;
  align-items: center;
}

/* 选项组布局 */
.option-group {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

/* 自定义复选框样式 - 提供更好的用户体验 */
.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  position: relative;
  user-select: none;
}

.checkbox-container:hover {
  background-color: rgba(79, 172, 254, 0.05);
}

.checkbox-container input[type="checkbox"] {
  display: none; /* 隐藏默认复选框 */
}

/* 自定义复选框外观 */
.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: white;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border-color: #4facfe;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-weight: bold;
  font-size: 12px;
}

/* 输入组样式 */
.input-group, .select-group {
  margin-bottom: 12px;
}

.input-group label, .select-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.input-group input, .select-group select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 12px;
  transition: all 0.3s ease;
  background: white;
}

.input-group input:focus, .select-group select:focus {
  outline: none;
  border-color: #4facfe;
  box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

/* 进度条样式 - 提供实时反馈 */
.progress-section {
  margin: 16px 0;
  padding: 12px;
  background: #f0f8ff;
  border-radius: 8px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 11px;
  color: #666;
  text-align: center;
}

/* 按钮样式 - 现代化设计 */
.actions-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.generate-btn, .preview-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.generate-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  grid-column: span 2; /* 占据整行 */
}

.preview-btn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  grid-column: span 2;
}

.generate-btn:hover, .preview-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.generate-btn:disabled, .preview-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  font-size: 14px;
}

/* 底部提示区域 */
footer {
  padding: 16px;
  background: #f8f9fa;
  border-radius: 0 0 12px 12px;
  border-top: 1px solid #e9ecef;
}

.tips p {
  font-size: 11px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 600;
}

.tips ul {
  list-style: none;
  padding: 0;
}

.tips li {
  font-size: 10px;
  color: #777;
  padding: 2px 0;
  position: relative;
  padding-left: 16px;
}

.tips li::before {
  content: '•';
  color: #4facfe;
  position: absolute;
  left: 4px;
}

/* 响应式调整 - 适应不同屏幕尺寸 */
@media (max-height: 500px) {
  .tips {
    display: none; /* 小屏幕时隐藏提示 */
  }
  
  .container {
    margin: 4px;
  }
  
  main {
    padding: 12px;
  }
}

/* 滚动条样式优化 */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  animation: fadeIn 0.3s ease-out;
}

/* 输入验证样式 */
.input-group input:invalid {
  border-color: #ff6b6b;
}

.input-group input:valid {
  border-color: #51cf66;
} 